import { base } from '@/config'
import http from '@/utils/request'

// 帮助中心
const help = {
  // 列表
  getList: params => {
    return http.get(`${base.platform}/helpCenter/getList`, params)
  },
  // 新增
  add: params => {
    return http.postJson(`${base.platform}/helpCenter/add`, params)
  },
  // 删除
  delete: id => {
    return http.postJson(`${base.platform}/helpCenter/delete/${id}`)
  },
  // 详情
  getDetail: id => {
    return http.get(`${base.platform}/helpCenter/get/${id}`)
  },
  // 获取栏目
  getTabCodeList: platform => {
    return http.get(`${base.platform}/helpCenter/getTabCodeList`, platform)
  },
  // 修改
  update: params => {
    return http.postJson(`${base.platform}/helpCenter/update`, params)
  },
  // 显示、隐藏
  updateStatus: ({ id, hiddenStatus }) => {
    return http.postJson(`${base.platform}/helpCenter/updateHidden/${id}/${hiddenStatus}`)
  }
}

export default help
